home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / EMACS.13 < prev    next >
Text File  |  1993-03-28  |  50KB  |  1,267 lines

  1. Info file ../info/emacs, produced by Makeinfo, -*- Text -*- from input
  2. file lemacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992 Lucid, Inc.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of
  10. this manual provided the copyright notice and this permission notice
  11. are preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided also
  15. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  16. General Public License" are included exactly as in the original, and
  17. provided that the entire resulting derived work is distributed under
  18. the terms of a permission notice identical to this one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the sections entitled "The GNU Manifesto",
  23. "Distribution" and "GNU General Public License" may be included in a
  24. translation approved by the author instead of in the original English.
  25.  
  26. 
  27. File: emacs,  Node: Keystrokes,  Next: Representing Keystrokes,  Prev: Screen,  Up: Top
  28.  
  29. Keystrokes as Building Blocks of Key Sequences
  30. ==============================================
  31.  
  32.    Earlier versions of GNU Emacs used only the ASCII character set,
  33. which defines 128 different character codes.  Some of these codes are
  34. assigned graphic symbols like `a' and `='; the rest are control
  35. characters, such as `Control-a' (also called `C-a').  `C-a' means you
  36. hold down the CTRL key and then press `a'.
  37.  
  38.    Keybindings in Lucid GNU Emacs are no longer restricted to the set
  39. of keystrokes that can be represented in ASCII.  Emacs can now tell the
  40. difference between, for example, `Control-h', `Control-Shift-h', and
  41. `Backspace'.
  42.  
  43.    A keystroke is like a piano chord: you get it by simultaneously
  44. striking several keys.  To be more precise, a keystroke consists of a
  45. possibly empty set of modifiers followed by a single "keysym".  The
  46. set of modifiers is small; it consists of `Control', `Meta', `Super',
  47. `Hyper', and `Shift'.
  48.  
  49.    The rest of the keys on your keyboard, along with the mouse buttons,
  50. make up the set of keysyms.  A keysym is usually what is printed on the
  51. keys on your keyboard.  Here is a table of some of the symbolic names
  52. for keysyms:
  53.  
  54. `a,b,c...'
  55.      alphabetic keys
  56.  
  57. `f1,f2...'
  58.      function keys
  59.  
  60. `button1'
  61.      left mouse button
  62.  
  63. `button2'
  64.      middle mouse button
  65.  
  66. `button3'
  67.      right mouse button
  68.  
  69. `button1up'
  70.      upstroke on the left mouse button
  71.  
  72. `button2up'
  73.      upstroke on the middle mouse button
  74.  
  75. `button3up'
  76.      upstroke on the right mouse button
  77.  
  78. `return'
  79.      Return key
  80.  
  81.    Use the variable `keyboard-translate-table' only if you are on a
  82. dumb tty, as it cannot handle input that cannot be represented as
  83. ASCII.  The value of this variable is a string used as a translate
  84. table for keyboard input or `nil'.  Each character is looked up in this
  85. string and the contents used instead.  If the string is of length `n',
  86. character codes `N' and up are untranslated.  If you are running Emacs
  87. under X, you should do the translations with the `xmodmap' program
  88. instead.
  89.  
  90. * Menu:
  91.  
  92. * Representing Keystrokes::  Using lists of modifiers and keysyms to
  93.                              represent keystrokes.
  94. * Key Sequences::            Combine key strokes into key sequences you can
  95.                              bind to commands.
  96. * String Key Sequences::     Available for upward compatibility.
  97. * Meta Key::                 Using ESC to represent Meta
  98. * Super and Hyper Keys::     Adding modifier keys on certain keyboards.
  99. * Character Representation:: How characters appear in Emacs buffers.
  100. * Commands::                 How commands are bound to key sequences.
  101.  
  102. 
  103. File: emacs,  Node: Representing Keystrokes,  Next: Key Sequences,  Prev: Keystrokes,  Up: Top
  104.  
  105. Representing Keystrokes
  106. -----------------------
  107.  
  108.    Lucid GNU Emacs represents keystrokes as lists. Each list consists
  109. of an arbitrary combination of modifiers followed by a single keysym
  110. at the end of the list.  If the keysym corresponds to an ASCII
  111. character, you can use its character code.  (A keystroke may also be
  112. represented by an event object, as returned by the `read-key-sequence'
  113. function; non-programmers need not worry about this.)
  114.  
  115.    The following table gives some examples of how to list
  116. representations for keystrokes.  Each list consists of sets of
  117. modifiers followed by keysyms:
  118.  
  119. `(control a)'
  120.      Pressing CTRL and `a' simultaneously.
  121.  
  122. `(control ?a)'
  123.      Another way of writing the keystroke `C-a'.
  124.  
  125. `(control 65)'
  126.      Yet another way of writing the keystroke `C-a'.
  127.  
  128. `(break)'
  129.      Pressing the BREAK key.
  130.  
  131. `(control meta button2up)'
  132.      Release the middle mouse button, while pressing CTRL and META.
  133.  
  134.    Note: As you define keystrokes, you can use the `shift' key only as
  135. a modifier with characters that do not have a second keysym on the
  136. same key, such as `backspace' and `tab'.  It is an error to define a
  137. keystroke using the shift modifier with keysyms such as `a' and `='. 
  138. The correct forms are `A' and `+'.
  139.  
  140. 
  141. File: emacs,  Node: Key Sequences,  Next: String Key Sequences,  Prev: Representing Keystrokes,  Up: Keystrokes
  142.  
  143. Representing Key Sequences
  144. --------------------------
  145.  
  146.    A "complete key sequence" is a sequence of keystrokes that Emacs
  147. understands as a unit.  Key sequences are significant because you can
  148. bind them to commands.  Note that not all sequences of keystrokes are
  149. possible key sequences.  In particular, the initial keystrokes in a key
  150. sequence must make up a "prefix key sequence".
  151.  
  152.    Emacs represents a key sequence as a vector of keystrokes.  Thus,
  153. the schematic representation of a complete key sequence is as follows:
  154.  
  155.        [(modifier .. modifer keysym) ... (modifier .. modifier keysym)]
  156.  
  157.    Here are some examples of complete key sequences:
  158.  
  159. `[(control c) (control a)]'
  160.      Typing `C-c' followed by `C-a'
  161.  
  162. `[(control c) (control 65)]'
  163.      Typing `C-c' followed by `C-a'. (Using the ASCII code for the
  164.      character `a')
  165.  
  166. `[(control c) (break)]'
  167.      Typing `C-c' followed by the `break' character.
  168.  
  169.    A "prefix key sequence" is the beginning of a series of longer
  170. sequences that are valid key sequences; adding any single keystroke to
  171. the end of a prefix results in a valid key sequence.  For example,
  172. `control-x' is standardly defined as a prefix.  Thus, there is a
  173. two-character key sequence starting with `C-x' for each valid
  174. keystroke, giving numerous possibilities.  Here are some samples:
  175.  
  176.    * `[(control x) (c)]'
  177.  
  178.    * `[(control x) (control c)]'
  179.  
  180.    Adding one character to a prefix key does not have to form a
  181. complete key.  It could make another, longer prefix.  For example,
  182. `[(control x) (\4)]' is itself a prefix that leads to any number of
  183. different three-character keys, including `[(control x) (\4) (f)]',
  184. `[(control x) (\4) (b)]' and so on.  It would be possible to define
  185. one of those three-character sequences as a prefix, creating a series
  186. of four-character keys, but we did not define any of them this way.
  187.  
  188.    By contrast, the two-character sequence `[(control f) (control k)]'
  189. is not a key, because the `(control f)' is a complete key sequence in
  190. itself.  It's impossible to give `[(control f (control k)]' an
  191. independent meaning as a command as long as `(control f)' retains its
  192. meaning, because what we have is really two commands.
  193.  
  194.    The predefined prefix key sequences in Emacs are `(control c)',
  195. `(control x)', `(control h)', `[(control x) (\4)]', and `escape'.  You
  196. can customize Emacs, and could make new prefix keys, or eliminate the
  197. default key sequences.  *Note Key Bindings::.
  198.  
  199.    Whether a particular key sequence is valid can be changed by
  200. customization.  For example, if you redefine `(control f)' as a
  201. prefix, `[(control f) (control k)]' automatically becomes a valid key
  202. sequence (complete, unless you define it as a prefix as well). 
  203. Conversely, if you remove the prefix definition of `[(control x)
  204. (\4)]', `[(control x) (\4) (f)]' (or `[(control x) (\4) ANYTHING]') is
  205. no longer a valid key sequence.
  206.  
  207.    Note that the above paragraphs uses \4 instead of simply 4, because
  208. \4 is the symbol whose name is "4", and plain 4 is the integer 4, which
  209. would have been interpreted as the ASCII value.  Another way of
  210. representing the symbol whose name is "4" is to write ?4, which would
  211. be interpreted as the number 52, which is the ASCII code for the
  212. character "4".  We could therefore actually have written 52 directly
  213. but that is far less clear.
  214.  
  215. 
  216. File: emacs,  Node: String Key Sequences,  Next: Meta Key,  Prev: Key Sequences,  Up: Keystrokes
  217.  
  218. String Key Sequences
  219. --------------------
  220.  
  221.    For backward compatibility, you may also represent a key sequence
  222. using strings.  For example, we have the following equivalent
  223. representations:
  224.  
  225. `"\C-c\C-c"'
  226.      `[(control c) (control c)]'
  227.  
  228. `"\e\C-c"'
  229.      `[(meta control c)]'
  230.  
  231. * Menu:
  232.  
  233. * Meta Key:: Assignment of the META Key
  234. * Super and Hyper Keys:: Assignment of the SUPER and HYPER Keys
  235.  
  236. 
  237. File: emacs,  Node: Meta Key,  Next: Super and Hyper Keys,  Prev: String Key Sequences,  Up: Keystrokes
  238.  
  239. Assignment of the META Key
  240. --------------------------
  241.  
  242.    Not all terminals have the complete set of modifiers.  Terminals
  243. that have a Meta key allow you to type Meta characters by just holding
  244. that key down.  To type `Meta-a', hold down META and press `a'.  On
  245. those terminals, the META key works like the SHIFT key.  Such a key is
  246. not always labeled META, however, as this function is often a special
  247. option for a key with some other primary purpose.
  248.  
  249.    If there is no META key, you can still type Meta characters using
  250. two-character sequences starting with ESC.  To enter `M-a', you could
  251. type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC is
  252. allowed on terminals with Meta keys, too, in case you have formed a
  253. habit of using it.
  254.  
  255.    If you are running under X and do not have a Meta key, it is
  256. possible to reconfigure some other key to be a Meta key.  *Note Super
  257. and Hyper Keys::.
  258.  
  259.    Emacs believes the terminal has a META key if the variable
  260. `meta-flag' is non-`nil'.  Normally this is set automatically
  261. according to the termcap entry for your terminal type.  However,
  262. sometimes the termcap entry is wrong, and then it is useful to set
  263. this variable yourself.  *Note Variables::, for how to do this.
  264.  
  265.    Note: If you are running under the X window system, the setting of
  266. the `meta-flag' variable is irrelevant.
  267.  
  268. 
  269. File: emacs,  Node: Super and Hyper Keys,  Next: Character Representation,  Prev: Meta Key,  Up: Keystrokes
  270.  
  271. Assignment of the SUPER and HYPER Keys
  272. --------------------------------------
  273.  
  274.    Most keyboards do not, by default, have SUPER or HYPER modifier
  275. keys.  Under X, you can simulate the SUPER or HYPER key if you want to
  276. bind keys to sequences using `super' and `hyper'.  You can use the
  277. `xmodmap' program to do this.
  278.  
  279.    For example, to turn your CAPS-LOCK key into a SUPER key, do the
  280. following:
  281.  
  282.    Create a file called `~/.xmodmap'.  In this file, place the lines
  283.  
  284.          remove Lock = Caps_Lock
  285.          keysym Caps_Lock = Super_L
  286.          add Mod2 = Super_L
  287.  
  288.    The first line says that the key that is currently called
  289. `Caps_Lock' should no longer behave as a "lock" key.  The second line
  290. says that this should now be called `Super_L' instead.  The third line
  291. says that the key called `Super_L' should be a modifier key, which
  292. produces the `Mod2' modifier.
  293.  
  294.    To create a Meta or Hyper key instead of a Super key, replace the
  295. word "Super" above with Meta or Hyper.
  296.  
  297.    Just after you start up X, execute the command `xmodmap /.xmodmap'. 
  298. You can add this command to the appropriate initialization file to have
  299. the command executed automatically.
  300.  
  301.    If you have problems, see the documentation for the `xmodmap'
  302. program.  The X keyboard model is quite complicated, and explaining it
  303. is beyond the scope of this manual.
  304.  
  305. 
  306. File: emacs,  Node: Key Bindings,  Next: Syntax,  Prev: Keyboard Macros,  Up: Customization
  307.  
  308. Customizing Key Bindings
  309. ========================
  310.  
  311.    This section deals with the "keymaps" which define the bindings
  312. between keys and functions, and shows how you can customize these
  313. bindings.
  314.  
  315.    A command is a Lisp function whose definition provides for
  316. interactive use.  Like every Lisp function, a command has a function
  317. name, a Lisp symbol whose name usually consists of lower case letters
  318. and hyphens.
  319.  
  320. * Menu:
  321.  
  322. * Keymaps::    Definition of the keymap data structure.
  323.                Names of Emacs's standard keymaps.
  324. * Rebinding::  How to redefine one key's meaning conveniently.
  325. * Disabling::  Disabling a command means confirmation is required
  326.                 before it can be executed.  This is done to protect
  327.                 beginners from surprises.
  328.  
  329. 
  330. File: emacs,  Node: Keymaps,  Next: Disabling,  Up: Key Bindings
  331.  
  332. Keymaps
  333. -------
  334.  
  335.    The bindings between characters and command functions are recorded
  336. in data structures called "keymaps".  Emacs has many of these.  One,
  337. the "global" keymap, defines the meanings of the single-character keys
  338. that are defined regardless of major mode.  It is the value of the
  339. variable `global-map'.
  340.  
  341.    Each major mode has another keymap, its "local keymap", which
  342. contains overriding definitions for the single-character keys that are
  343. redefined in that mode.  Each buffer records which local keymap is
  344. installed for it at any time, and the current buffer's local keymap is
  345. the only one that directly affects command execution.  The local
  346. keymaps for Lisp mode, C mode, and many other major modes always exist
  347. even when not in use.  They are the values of the variables
  348. `lisp-mode-map', `c-mode-map', and so on.  For less frequently used
  349. major modes, the local keymap is sometimes constructed only when the
  350. mode is used for the first time in a session, to save space.
  351.  
  352.    There are local keymaps for the minibuffer too; they contain various
  353. completion and exit commands.
  354.  
  355.    * `minibuffer-local-map' is used for ordinary input (no completion).
  356.  
  357.    * `minibuffer-local-ns-map' is similar, except that SPC exits just
  358.      like RET.  This is used mainly for Mocklisp compatibility.
  359.  
  360.    * `minibuffer-local-completion-map' is for permissive completion.
  361.  
  362.    * `minibuffer-local-must-match-map' is for strict completion and
  363.      for cautious completion.
  364.  
  365.    * `repeat-complex-command-map' is for use in `C-x ESC'.
  366.  
  367.    * `isearch-mode-map' contains the bindings of the special keys which
  368.      are bound in the pseudo-mode entered with `C-s' and `C-r'.
  369.  
  370.    Finally, each prefix key has a keymap which defines the key
  371. sequences that start with it.  For example, `ctl-x-map' is the keymap
  372. used for characters following a `C-x'.
  373.  
  374.    * `ctl-x-map' is the variable name for the map used for characters
  375.      that follow `C-x'.
  376.  
  377.    * `help-map' is used for characters that follow `C-h'.
  378.  
  379.    * `esc-map' is for characters that follow ESC. All Meta characters
  380.      are actually defined by this map.
  381.  
  382.    * `ctl-x-4-map' is for characters that follow `C-x 4'.
  383.  
  384.    * `mode-specific-map' is for characters that follow `C-c'.
  385.  
  386.    The definition of a prefix key is the keymap to use for looking up
  387. the following character.  Sometimes, the definition is actually a Lisp
  388. symbol whose function definition is the following character keymap. 
  389. The effect is the same, but it provides a command name for the prefix
  390. key that you can use as a description of what the prefix key is for. 
  391. Thus, the binding of `C-x' is the symbol `Ctl-X-Prefix', whose function
  392. definition is the keymap for `C-x' commands, the value of `ctl-x-map'.
  393.  
  394.    Prefix key definitions can appear in either the global map or a
  395. local map.  The definitions of `C-c', `C-x', `C-h' and ESC as prefix
  396. keys appear in the global map, so these prefix keys are always
  397. available.  Major modes can locally redefine a key as a prefix by
  398. putting a prefix key definition for it in the local map.
  399.  
  400.    A mode can also put a prefix definition of a global prefix
  401. character such as `C-x' into its local map.  This is how major modes
  402. override the definitions of certain keys that start with `C-x'.  This
  403. case is special, because the local definition does not entirely
  404. replace the global one.  When both the global and local definitions of
  405. a key are other keymaps, the next character is looked up in both
  406. keymaps, with the local definition overriding the global one.  So, the
  407. character after the `C-x' is looked up in both the major mode's own
  408. keymap for redefined `C-x' commands and in `ctl-x-map'.  If the major
  409. mode's own keymap for `C-x' commands contains `nil', the definition
  410. from the global keymap for `C-x' commands is used.
  411.  
  412. * Menu:
  413.  
  414. * Rebinding::                 Changing Key Bindings Interactively
  415. * Programmatic Rebinding::    Changing Key Bindings Programmatically
  416. * Key Bindings Using Strings::Using Strings for Changings Key Bindings
  417.  
  418. 
  419. File: emacs,  Node: Rebinding,  Next: Programmatic Rebinding,  Prev: Keymaps,  Up: Keymaps
  420.  
  421. Changing Key Bindings Interactively
  422. -----------------------------------
  423.  
  424.    You can redefine an Emacs key by changing its entry in a keymap. 
  425. You can change the global keymap, in which case the change is
  426. effective in all major modes except those that have their own
  427. overriding local definitions for the same key.  Or you can change the
  428. current buffer's local map, which affects all buffers using the same
  429. major mode.
  430.  
  431. `M-x global-set-key RET KEY CMD RET'
  432.      Defines KEY globally to run CMD.
  433.  
  434. `M-x local-set-key RET KEYS CMD RET'
  435.      Defines KEY locally (in the major mode now in effect) to run CMD.
  436.  
  437. `M-x local-unset-key RET KEYS RET'
  438.      Removes the local binding of KEY.
  439.  
  440.    CMD is a symbol naming an interactively-callable function.
  441.  
  442.    When called interactively, KEY is the next complete key sequence
  443. that you type.  When called as a function, KEY is a string, a vector
  444. of events or a vector of key-description lists as described in the the
  445. `define-key' function description.  The binding goes in the current
  446. buffer's local map, which is shared with other buffers in the same
  447. major mode.
  448.  
  449.    The following example,
  450.  
  451.      M-x global-set-key RET C-f next-line RET
  452.  
  453. redefines `C-f' to move down a line.  The fact that CMD is read second
  454. makes it serve as a kind of confirmation for KEY.
  455.  
  456.    These functions offer no way to specify a particular prefix keymap
  457. as the one to redefine in, but that is not necessary, as you can
  458. include prefixes in KEY.  KEY is read by reading characters one by one
  459. until they amount to a complete key (that is, not a prefix key). 
  460. Thus, if you type `C-f' for KEY, Emacs enters the minibuffer
  461. immediately to read CMD.  But if you type `C-x', another character is
  462. read; if that character is `4', another character is read, and so on. 
  463. For example,
  464.  
  465.      M-x global-set-key RET C-x 4 $ spell-other-window RET
  466.  
  467. redefines `C-x 4 $' to run the (fictitious) command
  468. `spell-other-window'.
  469.  
  470.    The most general way to modify a keymap is the function
  471. `define-key', used in Lisp code (such as your `.emacs' file). 
  472. `define-key' takes three arguments: the keymap, the key to modify in
  473. it, and the new definition.  *Note Init File::, for an example. 
  474. `substitute-key-definition' is used similarly; it takes three
  475. arguments, an old definition, a new definition and a keymap, and
  476. redefines in that keymap all keys that were previously defined with the
  477. old definition to have the new definition instead.
  478.  
  479. 
  480. File: emacs,  Node: Programmatic Rebinding,  Next: Key Bindings Using Strings,  Prev: Rebinding,  Up: Keymaps
  481.  
  482. Changing Key Bindings Programmatically
  483. --------------------------------------
  484.  
  485.    You can use the functions `global-set-key' and `define-key' to
  486. rebind keys under program control.
  487.  
  488. ``(global-set-key KEYS CMD)''
  489.      Defines KEYS globally to run CMD.
  490.  
  491. ``(define-key KEYMAP KEYS DEF)''
  492.      Defines KEYS to run CMD in the keymap KEYMAP.
  493.  
  494.    KEYMAP is a keymap object.
  495.  
  496.    KEYS is the sequence of keystrokes to bind.
  497.  
  498.    DEF is anything that can be a key's definition:
  499.  
  500.    * `nil' meaning key is undefined in this keymap.
  501.  
  502.    * A command, that is, a Lisp function suitable for interactive
  503.      calling.
  504.  
  505.    * A string or key sequence vector, which is treated as a keyboard
  506.      macro.
  507.  
  508.    * A keymap to define a prefix key.
  509.  
  510.    * A symbol so that when the key is looked up, the symbol stands for
  511.      its function definition, which should at that time be one of the
  512.      above, or another symbol whose function definition is used, and
  513.      so on.
  514.  
  515.    * A cons, `(string . defn)', meaning that DEFN is the definition
  516.      (DEFN should be a valid definition in its own right).
  517.  
  518.    * A cons, `(keymap . char)', meaning use the definition of CHAR in
  519.      map KEYMAP.
  520.  
  521.    For backward compatibility, Lucid GNU Emacs allows you to specify
  522. key sequences as strings.  However, the preferred method is to use the
  523. representations of key sequences as vectors of keystrokes.  *Note
  524. Keystrokes::, for more information about the rules for constructing
  525. key sequences.
  526.  
  527.    Emacs allows you to abbreviate representations for key sequences in
  528. most places where there is no ambiguity.  Here are some rules for
  529. abbreviation:
  530.  
  531.    * The keysym by itself is equivalent to a list of just that keysym,
  532.      i.e.  `f1' is equivalent to `(f1)'.
  533.  
  534.    * A keystroke by itself is equivalent to a vector containing just
  535.      that keystroke, i.e.  `(control a)' is equivalent to `[(control
  536.      a)]'
  537.  
  538.    * You can use ASCII codes for keysyms that have them. i.e.  `65' is
  539.      equivalent to `A'. (This is not so much an abbreviation as an
  540.      alternate representation.)
  541.  
  542.    Here are some examples of programmatically binding keys:
  543.  
  544.  
  545.      ;;;  Bind `my-command' to f1
  546.      
  547.      (global-set-key 'f1 'my-command)
  548.      
  549.      ;;;  Bind `my-command' to `Shift-f1'
  550.      (global-set-key '(shift f1) 'my-command)
  551.      
  552.      ;;; Bind `my-command' to `C-c Shift-f1'
  553.      (global-set-key '[(control c) (shift f1)] 'my-command)
  554.      
  555.      ;;; Bind `my-command' to the middle mouse button.
  556.      (global-set-key 'button2 'my-command)
  557.      
  558.      ;;; Bind `my-command' to `META CTL Right Mouse Button'
  559.      ;;; in the keymap that is in force when you are running `dired'.
  560.      (define-key dired-mode-map '(meta control button3) 'my-command)
  561.  
  562. 
  563. File: emacs,  Node: Key Bindings Using Strings,  Prev: Programmatic Rebinding,  Up: Keymaps
  564.  
  565.    For backward compatibility, you can still use strings to represent
  566. key sequences.  Thus you can use comands like the following:
  567.  
  568.      ;;; Bind `end-of-line' to `C-f'
  569.      (global-set-key "\C-f" 'end-of-line)
  570.  
  571.    Note, however, that in some cases you may be binding more than one
  572. key sequence by using a single command.  This situation can arise
  573. because in ASCII, `C-i' and TAB have the same representation. 
  574. Therefore, when Emacs sees:
  575.  
  576.      (global-set-key "\C-i" 'end-of-line)
  577.  
  578.    it is unclear whether the user intended to bind `C-i' or TAB.  The
  579. solution Lucid GNU Emacs adopts is to bind both of these key sequences.
  580.  
  581.    After binding a command to two key sequences with a form like
  582.  
  583.          (define-key global-map "\^X\^I" 'command-1)
  584.  
  585.    it is possible to redefine only one of those sequences like so:
  586.  
  587.          (define-key global-map [(control x) (control i)] 'command-2)
  588.          (define-key global-map [(control x) tab] 'command-3)
  589.  
  590.    This applies only when running under a window system.  If you are
  591. talking to Emacs through an ASCII-only channel, you do not get any of
  592. these features.
  593.  
  594.    Here is a table of pairs of key sequences that behave in a similar
  595. fashion:
  596.  
  597.              control h      backspace
  598.              control l      clear
  599.              control i      tab
  600.              control m      return
  601.              control j      linefeed
  602.              control [      escape
  603.              control @      control space
  604.  
  605. 
  606. File: emacs,  Node: Disabling,  Prev: Keymaps,  Up: Key Bindings
  607.  
  608. Disabling Commands
  609. ------------------
  610.  
  611.    Disabling a command marks it as requiring confirmation before it
  612. can be executed.  The purpose of disabling a command is to prevent
  613. beginning users from executing it by accident and being confused.
  614.  
  615.    The direct mechanism for disabling a command is to have a non-`nil'
  616. `disabled' property on the Lisp symbol for the command.  These
  617. properties are normally set by the user's `.emacs' file with Lisp
  618. expressions such as
  619.  
  620.      (put 'delete-region 'disabled t)
  621.  
  622.    If the value of the `disabled' property is a string, that string is
  623. included in the message printed when the command is used:
  624.  
  625.      (put 'delete-region 'disabled
  626.           "Text deleted this way cannot be yanked back!\n")
  627.  
  628.    You can disable a command either by editing the `.emacs' file
  629. directly or with the command `M-x disable-command', which edits the
  630. `.emacs' file for you.  *Note Init File::.
  631.  
  632.    When you attempt to invoke a disabled command interactively in
  633. Emacs, a window is displayed containing the command's name, its
  634. documentation, and some instructions on what to do next; then Emacs
  635. asks for input saying whether to execute the command as requested,
  636. enable it and execute, or cancel it.  If you decide to enable the
  637. command, you are asked whether to do this permanently or just for the
  638. current session.  Enabling permanently works by automatically editing
  639. your `.emacs' file.  You can use `M-x enable-command' at any time to
  640. enable any command permanently.
  641.  
  642.    Whether a command is disabled is independent of what key is used to
  643. invoke it; it also applies if the command is invoked using `M-x'. 
  644. Disabling a command has no effect on calling it as a function from Lisp
  645. programs.
  646.  
  647. 
  648. File: emacs,  Node: Syntax,  Next: Init File,  Prev: Key Bindings,  Up: Customization
  649.  
  650. The Syntax Table
  651. ================
  652.  
  653.    All the Emacs commands which parse words or balance parentheses are
  654. controlled by the "syntax table".  The syntax table specifies which
  655. characters are opening delimiters, which are parts of words, which are
  656. string quotes, and so on.  Actually, each major mode has its own syntax
  657. table (though sometimes related major modes use the same one) which it
  658. installs in each buffer that uses that major mode.  The syntax table
  659. installed in the current buffer is the one that all commands use, so we
  660. call it "the" syntax table.  A syntax table is a Lisp object, a vector
  661. of length 256 whose elements are numbers.
  662.  
  663. * Menu:
  664.  
  665. * Entry: Syntax Entry.    What the syntax table records for each character.
  666. * Change: Syntax Change.  How to change the information.
  667.  
  668. 
  669. File: emacs,  Node: Syntax Entry,  Next: Syntax Change,  Prev: Syntax,  Up: Syntax
  670.  
  671. Information about Each Character
  672. --------------------------------
  673.  
  674.    The syntax table entry for a character is a number that encodes six
  675. pieces of information:
  676.  
  677.    * The syntactic class of the character, represented as a small
  678.      integer.
  679.  
  680.    * The matching delimiter, for delimiter characters only.  The
  681.      matching delimiter of `(' is `)', and vice versa.
  682.  
  683.    * A flag saying whether the character is the first character of a
  684.      two-character comment starting sequence.
  685.  
  686.    * A flag saying whether the character is the second character of a
  687.      two-character comment starting sequence.
  688.  
  689.    * A flag saying whether the character is the first character of a
  690.      two-character comment ending sequence.
  691.  
  692.    * A flag saying whether the character is the second character of a
  693.      two-character comment ending sequence.
  694.  
  695.    The syntactic classes are stored internally as small integers, but
  696. are usually described to or by the user with characters.  For example,
  697. `(' is used to specify the syntactic class of opening delimiters. 
  698. Here is a table of syntactic classes, with the characters that specify
  699. them.
  700.  
  701. ` '
  702.      The class of whitespace characters.
  703.  
  704. `w'
  705.      The class of word-constituent characters.
  706.  
  707. `_'
  708.      The class of characters that are part of symbol names but not
  709.      words.  This class is represented by `_' because the character `_'
  710.      has this class in both C and Lisp.
  711.  
  712. `.'
  713.      The class of punctuation characters that do not fit into any other
  714.      special class.
  715.  
  716. `('
  717.      The class of opening delimiters.
  718.  
  719. `)'
  720.      The class of closing delimiters.
  721.  
  722. `''
  723.      The class of expression-adhering characters.  These characters are
  724.      part of a symbol if found within or adjacent to one, and are part
  725.      of a following expression if immediately preceding one, but are
  726.      like whitespace if surrounded by whitespace.
  727.  
  728. `"'
  729.      The class of string-quote characters.  They match each other in
  730.      pairs, and the characters within the pair all lose their syntactic
  731.      significance except for the `\' and `/' classes of escape
  732.      characters, which can be used to include a string-quote inside the
  733.      string.
  734.  
  735. `$'
  736.      The class of self-matching delimiters.  This is intended for TeX's
  737.      `$', which is used both to enter and leave math mode.  Thus, a
  738.      pair of matching `$' characters surround each piece of math mode
  739.      TeX input.  A pair of adjacent `$' characters act like a single
  740.      one for purposes of matching
  741.  
  742. `/'
  743.      The class of escape characters that always just deny the following
  744.      character its special syntactic significance.  The character
  745.      after one of these escapes is always treated as alphabetic.
  746.  
  747. `\'
  748.      The class of C-style escape characters.  In practice, these are
  749.      treated just like `/'-class characters, because the extra
  750.      possibilities for C escapes (such as being followed by digits)
  751.      have no effect on where the containing expression ends.
  752.  
  753. `<'
  754.      The class of comment-starting characters.  Only single-character
  755.      comment starters (such as `;' in Lisp mode) are represented this
  756.      way.
  757.  
  758. `>'
  759.      The class of comment-ending characters.  Newline has this syntax
  760.      in Lisp mode.
  761.  
  762.    The characters flagged as part of two-character comment delimiters
  763. can have other syntactic functions most of the time.  For example, `/'
  764. and `*' in C code, when found separately, have nothing to do with
  765. comments.  The comment-delimiter significance overrides when the pair
  766. of characters occur together in the proper order.  Only the list and
  767. sexp commands use the syntax table to find comments; the commands
  768. specifically for comments have other variables that tell them where to
  769. find comments.  And the list and sexp commands notice comments only if
  770. `parse-sexp-ignore-comments' is non-`nil'.  This variable is set to
  771. `nil' in modes where comment-terminator sequences are liable to appear
  772. where there is no comment; for example, in Lisp mode where the comment
  773. terminator is a newline but not every newline ends a comment.
  774.  
  775. 
  776. File: emacs,  Node: Syntax Change,  Prev: Syntax Entry,  Up: Syntax
  777.  
  778. Altering Syntax Information
  779. ---------------------------
  780.  
  781.    It is possible to alter a character's syntax table entry by storing
  782. a new number in the appropriate element of the syntax table, but it
  783. would be hard to determine what number to use.  Emacs therefore
  784. provides a command that allows you to specify the syntactic properties
  785. of a character in a convenient way.
  786.  
  787.    `M-x modify-syntax-entry' is the command to change a character's
  788. syntax.  It can be used interactively, and is also used by major modes
  789. to initialize their own syntax tables.  Its first argument is the
  790. character to change.  The second argument is a string that specifies
  791. the new syntax.  When called from Lisp code, there is a third, optional
  792. argument, which specifies the syntax table in which to make the
  793. change.  If not supplied, or if this command is called interactively,
  794. the third argument defaults to the current buffer's syntax table.
  795.  
  796.   1. The first character in the string specifies the syntactic class. 
  797.      It is one of the characters in the previous table (*note Syntax
  798.      Entry::.).
  799.  
  800.   2. The second character is the matching delimiter.  For a character
  801.      that is not an opening or closing delimiter, this should be a
  802.      space, and may be omitted if no following characters are needed.
  803.  
  804.   3. The remaining characters are flags.  The flag characters allowed
  805.      are
  806.  
  807.     `1'
  808.           Flag this character as the first of a two-character comment
  809.           starting sequence.
  810.  
  811.     `2'
  812.           Flag this character as the second of a two-character comment
  813.           starting sequence.
  814.  
  815.     `3'
  816.           Flag this character as the first of a two-character comment
  817.           ending sequence.
  818.  
  819.     `4'
  820.           Flag this character as the second of a two-character comment
  821.           ending sequence.
  822.  
  823.    Use `C-h s' (`describe-syntax') to display a description of the
  824. contents of the current syntax table.  The description of each
  825. character includes both the string you have to pass to
  826. `modify-syntax-entry' to set up that character's current syntax, and
  827. some English to explain that string if necessary.
  828.  
  829. 
  830. File: emacs,  Node: Init File,  Next: Audible Bell,  Prev: Syntax,  Up: Customization
  831.  
  832. The Init File, .emacs
  833. =====================
  834.  
  835.    When you start Emacs, it normally loads the file `.emacs' in your
  836. home directory.  This file, if it exists, should contain Lisp code.  It
  837. is called your initialization file or "init file".  Use the command
  838. line switches `-q' and `-u' to tell Emacs whether to load an init file
  839. (*note Entering Emacs::.).
  840.  
  841.    When the `.emacs' file is read, the variable `init-file-user' says
  842. which users init file it is.  The value may be the null string or a
  843. string containing a user's name.  If the value is a null string, it
  844. means that the init file was taken from the user that originally
  845. logged in.
  846.  
  847.    In all cases, `(concat "~" init-file-user "/")' evaluates to the
  848. directory name of the directory where the `.emacs' file was looked for.
  849.  
  850.    At some sites, there is a "default init file", which is the library
  851. named `default.el', found via the standard search path for libraries. 
  852. The Emacs distribution contains no such library; your site may create
  853. one for local customizations.  If this library exists, it is loaded
  854. whenever you start Emacs.  But your init file, if any, is loaded
  855. first; if it sets `inhibit-default-init' non-`nil', then `default' is
  856. not loaded.
  857.  
  858.    If you have a large amount of code in your `.emacs' file, you
  859. should move it into another file named `SOMETHING.el', byte-compile it
  860. (*note Lisp Libraries::.), and load that file from your `.emacs' file
  861. using `load'.
  862.  
  863. * Menu:
  864.  
  865. * Init Syntax::     Syntax of constants in Emacs Lisp.
  866. * Init Examples::   How to do some things with an init file.
  867. * Terminal Init::   Each terminal type can have an init file.
  868.  
  869. 
  870. File: emacs,  Node: Init Syntax,  Next: Init Examples,  Prev: Init File,  Up: Init File
  871.  
  872. Init File Syntax
  873. ----------------
  874.  
  875.    The `.emacs' file contains one or more Lisp function call
  876. expressions.  Each consists of a function name followed by arguments,
  877. all surrounded by parentheses.  For example, `(setq fill-column 60)'
  878. represents a call to the function `setq' which is used to set the
  879. variable `fill-column' (*note Filling::.) to 60.
  880.  
  881.    The second argument to `setq' is an expression for the new value of
  882. the variable.  This can be a constant, a variable, or a function call
  883. expression.  In `.emacs', constants are used most of the time.  They
  884. can be:
  885.  
  886. Numbers:
  887.      Integers are written in decimal, with an optional initial minus
  888.      sign.
  889.  
  890.      If a sequence of digits is followed by a period and another
  891.      sequence of digits, it is interpreted as a floating point number.
  892.  
  893. Strings:
  894.      Lisp string syntax is the same as C string syntax with a few extra
  895.      features.  Use a double-quote character to begin and end a string
  896.      constant.
  897.  
  898.      Newlines and special characters may be present literally in
  899.      strings.  They can also be represented as backslash sequences:
  900.      `\n' for newline, `\b' for backspace, `\r' for return, `\t' for
  901.      tab, `\f' for formfeed (control-l), `\e' for escape, `\\' for a
  902.      backslash, `\"' for a double-quote, or `\OOO' for the character
  903.      whose octal code is OOO.  Backslash and double-quote are the only
  904.      characters for which backslash sequences are mandatory.
  905.  
  906.      You can use `\C-' as a prefix for a control character, as in
  907.      `\C-s' for ASCII Control-S, and `\M-' as a prefix for a meta
  908.      character, as in `\M-a' for Meta-A or `\M-\C-a' for
  909.      Control-Meta-A.
  910.  
  911. Characters:
  912.      Lisp character constant syntax consists of a `?' followed by
  913.      either a character or an escape sequence starting with `\'. 
  914.      Examples: `?x', `?\n', `?\"', `?\)'.  Note that strings and
  915.      characters are not interchangeable in Lisp; some contexts require
  916.      one and some contexts require the other.
  917.  
  918. True:
  919.      `t' stands for `true'.
  920.  
  921. False:
  922.      `nil' stands for `false'.
  923.  
  924. Other Lisp objects:
  925.      Write a single-quote (') followed by the Lisp object you want.
  926.  
  927. 
  928. File: emacs,  Node: Init Examples,  Next: Terminal Init,  Prev: Init Syntax,  Up: Init File
  929.  
  930. Init File Examples
  931. ------------------
  932.  
  933.    Here are some examples of doing certain commonly desired things with
  934. Lisp expressions:
  935.  
  936.    * Make TAB in C mode just insert a tab if point is in the middle of
  937.      a line.
  938.  
  939.           (setq c-tab-always-indent nil)
  940.  
  941.           Here we have a variable whose value is normally `t' for `true'
  942.      and the alternative is `nil' for `false'.
  943.  
  944.    * Make searches case sensitive by default (in all buffers that do
  945.      not override this).
  946.  
  947.           (setq-default case-fold-search nil)
  948.  
  949.           This sets the default value, which is effective in all buffers
  950.      that do not have local values for the variable.  Setting
  951.      `case-fold-search' with `setq' affects only the current buffer's
  952.      local value, which is probably not what you want to do in an init
  953.      file.
  954.  
  955.    * Make Text mode the default mode for new buffers.
  956.  
  957.           (setq default-major-mode 'text-mode)
  958.  
  959.           Note that `text-mode' is used because it is the command for
  960.      entering the mode we want.  A single-quote is written before it
  961.      to make a symbol constant; otherwise, `text-mode' would be
  962.      treated as a variable name.
  963.  
  964.    * Turn on Auto Fill mode automatically in Text mode and related
  965.      modes.
  966.  
  967.           (setq text-mode-hook
  968.             '(lambda () (auto-fill-mode 1)))
  969.  
  970.           Here we have a variable whose value should be a Lisp function. 
  971.      The function we supply is a list starting with `lambda', and a
  972.      single quote is written in front of it to make it (for the
  973.      purpose of this `setq') a list constant rather than an
  974.      expression.  Lisp functions are not explained here; for mode
  975.      hooks it is enough to know that `(auto-fill-mode 1)' is an
  976.      expression that will be executed when Text mode is entered.  You
  977.      could replace it with any other expression that you like, or with
  978.      several expressions in a row.
  979.  
  980.           (setq text-mode-hook 'turn-on-auto-fill)
  981.  
  982.           This is another way to accomplish the same result. 
  983.      `turn-on-auto-fill' is a symbol whose function definition is
  984.      `(lambda () (auto-fill-mode 1))'.
  985.  
  986.    * Load the installed Lisp library named `foo' (actually a file
  987.      `foo.elc' or `foo.el' in a standard Emacs directory).
  988.  
  989.           (load "foo")
  990.  
  991.           When the argument to `load' is a relative pathname, not starting
  992.      with `/' or `~', `load' searches the directories in `load-path'
  993.      (*note Loading::.).
  994.  
  995.    * Load the compiled Lisp file `foo.elc' from your home directory.
  996.  
  997.           (load "~/foo.elc")
  998.  
  999.           Here an absolute file name is used, so no searching is done.
  1000.  
  1001.    * Rebind the key `C-x l' to run the function `make-symbolic-link'.
  1002.  
  1003.           (global-set-key "\C-xl" 'make-symbolic-link)
  1004.  
  1005.           or
  1006.  
  1007.           (define-key global-map "\C-xl" 'make-symbolic-link)
  1008.  
  1009.           Note once again the single-quote used to refer to the symbol
  1010.      `make-symbolic-link' instead of its value as a variable.
  1011.  
  1012.    * Do the same thing for C mode only.
  1013.  
  1014.           (define-key c-mode-map "\C-xl" 'make-symbolic-link)
  1015.  
  1016.    * Bind the function key F1 to a command in C mode.  Note that the
  1017.      names of function keys must be lower case.
  1018.  
  1019.           (define-key c-mode-map 'f1 'make-symbolic-link)
  1020.  
  1021.    * Bind the shifted version of F1 to a command.
  1022.  
  1023.           (define-key c-mode-map '(shift f1) 'make-symbolic-link)
  1024.  
  1025.    * Redefine all keys which now run `next-line' in Fundamental mode
  1026.      to run `forward-line' instead.
  1027.  
  1028.           (substitute-key-definition 'next-line 'forward-line
  1029.                                      global-map)
  1030.  
  1031.    * Make `C-x C-v' undefined.
  1032.  
  1033.           (global-unset-key "\C-x\C-v")
  1034.  
  1035.           One reason to undefine a key is so that you can make it a prefix. 
  1036.      Simply defining `C-x C-v ANYTHING' would make `C-x C-v' a prefix,
  1037.      but `C-x C-v' must be freed of any non-prefix definition first.
  1038.  
  1039.    * Make `$' have the syntax of punctuation in Text mode.  Note the
  1040.      use of a character constant for `$'.
  1041.  
  1042.           (modify-syntax-entry ?\$ "." text-mode-syntax-table)
  1043.  
  1044.    * Enable the use of the command `eval-expression' without
  1045.      confirmation.
  1046.  
  1047.           (put 'eval-expression 'disabled nil)
  1048.  
  1049. 
  1050. File: emacs,  Node: Terminal Init,  Prev: Init Examples,  Up: Init File
  1051.  
  1052. Terminal-specific Initialization
  1053. --------------------------------
  1054.  
  1055.    Each terminal type can have a Lisp library to be loaded into Emacs
  1056. when it is run on that type of terminal.  For a terminal type named
  1057. TERMTYPE, the library is called `term/TERMTYPE' and it is found by
  1058. searching the directories `load-path' as usual and trying the suffixes
  1059. `.elc' and `.el'.  Normally it appears in the subdirectory `term' of
  1060. the directory where most Emacs libraries are kept.
  1061.  
  1062.    The usual purpose of the terminal-specific library is to define the
  1063. escape sequences used by the terminal's function keys using the library
  1064. `keypad.el'.  See the file `term/vt100.el' for an example of how this
  1065. is done.
  1066.  
  1067.    When the terminal type contains a hyphen, only the part of the name
  1068. before the first hyphen is significant in choosing the library name. 
  1069. Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library
  1070. `term/aaa'.  The code in the library can use `(getenv "TERM")' to find
  1071. the full terminal type name.
  1072.  
  1073.    The library's name is constructed by concatenating the value of the
  1074. variable `term-file-prefix' and the terminal type.  Your `.emacs' file
  1075. can prevent the loading of the terminal-specific library by setting
  1076. `term-file-prefix' to `nil'.
  1077.  
  1078.    The value of the variable `term-setup-hook', if not `nil', is
  1079. called as a function of no arguments at the end of Emacs
  1080. initialization, after both your `.emacs' file and any
  1081. terminal-specific library have been read.  You can set the value in
  1082. the `.emacs' file to override part of any of the terminal-specific
  1083. libraries and to define initializations for terminals that do not have
  1084. a library.
  1085.  
  1086. 
  1087. File: emacs,  Node: Audible Bell,  Next: Faces,  Prev: Init File,  Up: Customization
  1088.  
  1089. Changing the Bell Sound
  1090. =======================
  1091.  
  1092.    You can now change how the audible bell sounds using the variable
  1093. `sound-alist'.
  1094.  
  1095.    `sound-alist''s value is an alist associating symbols with strings
  1096. of audio-data.  When `ding' is called with one of the symbols, the
  1097. associated sound data is played instead of the standard beep.  This
  1098. only works if you are logged in on the console of a SPARCstation. To
  1099. listen to a sound of the provided type, call the function `play-sound'
  1100. with the argument SOUND. You can also set the volume of the sound with
  1101. the optional arugment VOLUME.
  1102.  
  1103.    Elements of the list should be of one of the following forms:
  1104.  
  1105.         ( symbol . string-or-symbol )
  1106.         ( symbol integer string-or-symbol )
  1107.  
  1108.    If `string-or-symbol' is a string, it should contain raw sound
  1109. data, the contents of a `.au' file.  If it is a symbol, the symbol is
  1110. considered an alias for some other element, and the sound-player looks
  1111. for that next.  If the integer is provided, it is the volume at which
  1112. the sound should be played, from 0 to 100.
  1113.  
  1114.    If an element of this alist begins with the symbol `default', that
  1115. sound is used when no other sound is appropriate.
  1116.  
  1117.    If the symbol `t' is in place of a sound-string, Emacs uses the
  1118. default X beep.  This allows you to define beep-types of different
  1119. volumes even when not running on the console of a SPARCstation.
  1120.  
  1121.    You can add things to this list by calling the function
  1122. `load-sound-file', which reads in an audio-file and adds its data to
  1123. the sound-alist. You can specify the sound with the SOUND-NAME
  1124. argument and the file into which the sounds are loaded with the
  1125. FILENAME argument. The optional VOLUME argument sets the volume.
  1126.  
  1127.    `load-sound-file (filename sound-name &optional volume)'
  1128.  
  1129.    To load and install some sound files as beep-types, use the function
  1130. `load-default-sounds' (note that this only works if you are on display
  1131. 0 of a SPARCstation).
  1132.  
  1133.    The following beep-types are used by Emacs itself. Other Lisp
  1134. packages may use other beep types, but these are the ones that the C
  1135. kernel of Emacs uses.
  1136.  
  1137. `auto-save-error'
  1138.      An auto-save does not succeed
  1139.  
  1140. `command-error'
  1141.      The Emacs command loop catches an error
  1142.  
  1143. `undefined-key'
  1144.      You type a key that is undefined
  1145.  
  1146. `undefined-click'
  1147.      You use an undefined mouse-click combination
  1148.  
  1149. `no-completion'
  1150.      Completion was not possible
  1151.  
  1152. `y-or-n-p'
  1153.      You type something other than the required `y' or `n'
  1154.  
  1155. `yes-or-no-p'
  1156.      When you type something other than `yes' or `no'
  1157.  
  1158. 
  1159. File: emacs,  Node: Faces,  Prev: Audible Bell,  Up: Customization
  1160.  
  1161. Faces
  1162. =====
  1163.  
  1164.    Lucid GNU Emacs has objects called extents and faces.  An "extent"
  1165. is a region of text and a "face" is a collection of textual
  1166. attributes, such as fonts and colors.  Every extent is displayed in
  1167. some face, therefore, changing the properties of a face immediately
  1168. updates the display of all associated extents.  Faces can be
  1169. screen-local: you can have a region of text that displays with
  1170. completely different attributes when its buffer is viewed from a
  1171. different X window.
  1172.  
  1173.    The display attributes of faces may be specified either in Lisp or
  1174. through the X resource manager.
  1175.  
  1176. Customizing Faces
  1177. -----------------
  1178.  
  1179.    You can change the face of an extent with the functions in this
  1180. section.  All the functions prompt for a FACE as an argument; use
  1181. completion for a list of possible values.
  1182.  
  1183. `M-x invert-face'
  1184.      Swap the foreground and background colors of the given FACE.
  1185.  
  1186. `M-x make-face-bold'
  1187.      Make the font of the given FACE bold.  When called from a
  1188.      program, returns `nil' if this is not possible.
  1189.  
  1190. `M-x make-face-bold-italic'
  1191.      Make the font of the given FACE bold italic.  When called from a
  1192.      program, returns `nil' if not possible.
  1193.  
  1194. `M-x make-face-italic'
  1195.      Make the font of the given FACE italic.  When called from a
  1196.      program, returns `nil' if not possible.
  1197.  
  1198. `M-x make-face-unbold'
  1199.      Make the font of the given FACE non-bold.  When called from a
  1200.      program, returns `nil' if not possible.
  1201.  
  1202. `M-x make-face-unitalic'
  1203.      Make the font of the given FACE non-italic.  When called from a
  1204.      program, returns `nil' if not possible.
  1205.  
  1206. `M-x set-face-background'
  1207.      Change the background color of the given FACE.
  1208.  
  1209. `M-x set-face-background-pixmap'
  1210.      Change the background pixmap of the given FACE.
  1211.  
  1212. `M-x set-face-font'
  1213.      Change the font of the given FACE.
  1214.  
  1215. `M-x set-face-foreground'
  1216.      Change the foreground color of the given FACE.
  1217.  
  1218. `M-x set-face-underline-p'
  1219.      Change whether the given FACE is underlined.
  1220.  
  1221.    You can exchange the foreground and background color of the selected
  1222. FACE with the function `invert-face'. If the face does not specify
  1223. both foreground and background, then its foreground and background are
  1224. set to the background and foreground of the default face.  When
  1225. calling this from a program, you can supply the optional argument
  1226. SCREEN to specify which screen is affected; otherwise, all screens are
  1227. affected.
  1228.  
  1229.    You can set the background color of the specified FACE with the
  1230. function `set-face-background'.  The argument `color' should be a
  1231. string, the name of a color.  When called from a program, if the
  1232. optional SCREEN argument is provided, the face is changed only in that
  1233. screen; otherwise, it is changed in all screens.
  1234.  
  1235.    You can set the background pixmap of the specified FACE with the
  1236. function `set-face-background-pixmap'.  The pixmap argument NAME
  1237. should be a string, the name of a file of pixmap data.  The
  1238. directories listed in the `x-bitmap-file-path' variable are searched. 
  1239. The bitmap may also be a list of the form `(width height data)' where
  1240. width and height are the size in pixels, and data is a string
  1241. containing the raw bits of the bitmap.  If the optional SCREEN
  1242. argument is provided, the face is changed only in that screen;
  1243. otherwise, it is changed in all screens.
  1244.  
  1245.    The variable `x-bitmap-file-path' takes as a value a list of the
  1246. directories in which X bitmap files may be found.  If the value is
  1247. `nil', the list is initialized from the `*bitmapFilePath' resource.
  1248.  
  1249.    You can set the font of the specified FACE with the function
  1250. `set-face-font'.  The FONT argument should be a string, the name of a
  1251. font.  When called from a program, if the optional SCREEN argument is
  1252. provided, the face is changed only in that screen; otherwise, it is
  1253. changed in all screens.
  1254.  
  1255.    You can set the foreground color of the specified FACE with the
  1256. function `set-face-foreground'.  The argument COLOR should be a
  1257. string, the name of a color.  If the optional SCREEN argument is
  1258. provided, the face is changed only in that screen; otherwise, it is
  1259. changed in all screens.
  1260.  
  1261.    You can set underline the specified FACE with the function
  1262. `set-face-underline-p'. The argument UNDERLINE-P can be used to make
  1263. underlining an attribute of the face or not. If the optional SCREEN
  1264. argument is provided, the face is changed only in that screen;
  1265. otherwise, it is changed in all screens.
  1266.  
  1267.